<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>信用分类信息推送</title>
	<script src="../../js/header.js"></script>
</head>

<body>
<div v-cloak id="app">
	<div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
		<el-row>
			<el-col :span="4" class="tab-title">
				已推送数据情况
			</el-col>
			<el-col :span="4" style="float:right">
				
				推送统计时间: {{year}}年{{month}}月{{day}}日
			
			</el-col>
		</el-row>
	</div>
	
	<el-table :data="tableData" border style="width: 100%;margin-top: 35px;" ref="multipleTable"
      @selection-change="handleSelectionChange" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
		<el-table-column
				prop="provice"
				label="地方名称"
				width=""
				align="center" >
		</el-table-column>
		<el-table-column
				prop="totalNumber"
				label="累积推送数量"
				width=""
				align="center">
		</el-table-column>
		<el-table-column
				prop="currentMonthNumber"
				label="本月推送数量"
				width=""
				align="center">
		</el-table-column>		
	</el-table>
	
	<div style="overflow: hidden;">
		<div class="pagination">
			<el-pagination
					@size-change="handleSizeChange"
					@current-change="handleCurrentChange"
					:current-page="currentPage"
					:page-sizes="[10, 20, 30, 40]"
					:page-size="pagesize"
					background
					layout="total, sizes,prev, pager, next"
					:total="tableTotal"
					prev-text="上一页"
					next-text="下一页">
			</el-pagination>
			
		</div>
		
	</div>
</div>
<script>
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                uuid:'',
                link:'',//iframe链接
                link2:'',//iframe链接
                currentPage: 1, //默认显示页面为1
                pagesize: 10, // 每页的数据条数
                year:'',
                month:'',
                day:'',
                tableTotal:'',
                tableData: '',
                multipleTable: []     //存放选中值的数组            
            }
        },
        created(){
            var userInfo = JSON.parse(localStorage.getItem('userInfo'));
            var userRole = userInfo.orgName;
            if(userRole.includes("建设单位")){
                this.hasApprovalBtn = false;
            }
            axios.get('../../json/ChinaCity.json').then(res=>{
                this.provinceData = res.data;
            }).catch(e => {
                this.$message.error("网络连接超时");
            })
        },
        mounted(){
        	let date = new Date();
	        let y = date.getFullYear();
	        let MM = date.getMonth() + 1;
	        MM = MM < 10 ? ('0' + MM) : MM;
	        let d = date.getDate();
	        d = d < 10 ? ('0' + d) : d;
	        let h = date.getHours();
	        h = h < 10 ? ('0' + h) : h;
	        let m = date.getMinutes();
	        m = m < 10 ? ('0' + m) : m;
	        let s = date.getSeconds();
	        s = s < 10 ? ('0' + s) : s;
	       	console.log(y + '-' + MM + '-' + d);
	       	this.year = y;
	       	this.month = MM;
	       	this.day = d;
            this.getData();           
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjzfjg/detail/getInfopush',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno                       
                    }
                })
				.then(response => {
					console.log(response)
					if (response.data.code == 200) {
						this.tableData = response.data.data.list;
						this.tableTotal = response.data.data.totalRecord;// 数据长度

					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});
           },
            handleChange(value) {
                console.log(value);
            },
            handleSelectionChange(val) {
      			this.multipleTable = val;               //  this.multipleTable 选中的值
		      	console.log(val);
		    },          
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
                /*console.log(this.pagesize) */
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            }
        }
    })
</script>
</body>
</html>